home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10396 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1023 b   |  38 lines

  1. Path: news.unt.edu!news
  2. From: Steve Fogoros <sfogoros@hsc.unt.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Urgent:  pow() in TurboC
  5. Date: Sun, 17 Mar 1996 10:19:57 -0800
  6. Organization: University of North Texas Health Science Center
  7. Message-ID: <314C57CD.3C17@hsc.unt.edu>
  8. References: <4igsu5$q1t@hatathli.csulb.edu>
  9. NNTP-Posting-Host: sfogoros.hsc.unt.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. David Cho wrote:
  16. > void main() {
  17. > long int k;
  18. >   k = pow(2,23);
  19. > }
  20. > When I try this, k gets 0.0.  Then I try smaller numbers like (2,3) and I
  21. > still get 0.0.  So I change the parameters to (2.0, 3.0) and I get
  22. > 255.00.  What is going on here?
  23. > Is there a bug in the compiler?  Please e-mail me.
  24.  
  25. No bug, pow returns a double not int. Don't forget to include math.h or it still 
  26. won't work right.
  27.  
  28. -- 
  29. Steve Fogoros, Academic Information Coordinator
  30. University of North Texas Health Science Center
  31. sfogoros@hsc.unt.edu
  32.